package mspbots.tsheets.business.core.sysuser;

import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.r2dbc.repository.R2dbcRepository;
import reactor.core.publisher.Mono;

/**
 * @author Jay.Yang
 */
public interface SysUserMappingRepository extends R2dbcRepository<SysUserMapping, Long> {

    @Query("select * from sys_user_mapping where mapping_user_id=:mappingUserId and user_type=:userType and tenant_code=:tenantCode limit 1")
    Mono<SysUserMapping> findByMappingUserIdAndUserTypeAndTenantCode(String mappingUserId, String userType, Long tenantCode);
}
